package org.jground.rx.def.apps.crm;
import org.jground.rx.*;
import org.jground.rx.gen.*;
import org.jground.util.*;
import java.util.List;
import org.jground.rx.def.apps.accounting.*;
import org.jground.rx.def.apps.commons.*;
import org.jground.rx.def.apps.knowledge.*;
import org.jground.rx.def.*;
import org.jground.rx.def.apps.cip.*;
import org.jground.rx.def.apps.core.*;
import org.jground.rx.def.apps.legal.*;
import org.jground.rx.def.apps.ipm.*;
@SuppressWarnings("unused")
public class IndividualCall extends GenRoot {

    public static final String moid = "org.jground.rx.def.apps.crm.IndividualCall";

    private static final String title ="title";
    private static final String callType ="callType";
    private static final String personContacted ="personContacted";
    private static final String timeNotes ="timeNotes";
    private static final String documents ="documents";
    private static final String status ="status";
    private static final String $CREATOR ="$CREATOR";

    public static final class AttName {
        public static final String title ="title";
        public static final String callType ="callType";
        public static final String personContacted ="personContacted";
        public static final String timeNotes ="timeNotes";
        public static final String documents ="documents";
        public static final String status ="status";
        public static final String $CREATOR ="$CREATOR";
    }

    public static IndividualCall createNew() { return new IndividualCall(RXObjectService.getInstance().create(moid)); }

    public static IndividualCall getById(String oid) { 
        IRXObject mod = RXObjectService.getInstance().getById(oid);
        if(mod == null) { return null; }
        return new IndividualCall(mod);
    }

    public static IndividualCall[] getByIds(String... oids) { 
        List<IRXObject> mods = RXObjectService.getInstance().getByIds(moid, oids);
        IndividualCall[] res = new IndividualCall[mods.size()];
        int i = 0;
        for(IRXObject mod : mods) {
            res[i] = new IndividualCall(mod);
            i++;
        }
        return res;
    }

    public static SearchCriteria newSearchCriteria() {
        return  SearchCriteria.create(moid);
    }

    public static IndividualCall[] search(SearchCriteria sc) {
        return  wrap(GenRoot._search(sc));
    }

    public static IndividualCall[] wrap(List<? extends IRXObjectSynopsis> mods) { 
        IndividualCall[] res = new IndividualCall[mods.size()];
        int i = 0;
        for(IRXObjectSynopsis mod : mods) {
            res[i] = new IndividualCall(mod);
            i++;
        }
        return res;
    }

    public static IndividualCall wrap(IRXObjectSynopsis mod) { 
        return new IndividualCall(mod);
    }

    private IndividualCall(IRXObjectSynopsis rxObject) {this.rxObject = (IRXObject) rxObject;}

    public static String getTitleLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, title).getLabel();
    }

    public static String getTitleDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, title).getDescription();
    }

    public void setTitle(String string) {
        rxObject.set(title, _to_String(string));
    }

    public String getTitle() {
        return _to_String(rxObject.getCurrentValue(title));
    }

    public static String getCallTypeLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, callType).getLabel();
    }

    public static String getCallTypeDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, callType).getDescription();
    }

    public void setCallType(String codeValue) {
        rxObject.set(callType, _to_String(codeValue));
    }

    public String getCallType() {
        return _to_String(rxObject.getCurrentValue(callType));
    }

    public static String getPersonContactedLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, personContacted).getLabel();
    }

    public static String getPersonContactedDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, personContacted).getDescription();
    }

    public void addPersonContacted(org.jground.rx.def.apps.core.Person... value) {
        rxObject.set(personContacted, _to_String(value));
    }

    public void setPersonContacted(org.jground.rx.def.apps.core.Person[] values) {
        rxObject.set(personContacted, _to_String(values));
    }

    public int getPersonContactedSize() {
        return StringUtils.rnn(rxObject.getValues(personContacted)).length;
    }

    public org.jground.rx.def.apps.core.Person[] getPersonContacted() {
        return org.jground.rx.def.apps.core.Person.getByIds(rxObject.getValues(personContacted));
    }

    public org.jground.rx.def.apps.core.Person getPersonContacted(int index) {
        return org.jground.rx.def.apps.core.Person.getByIds(rxObject.getValues(personContacted))[index];
    }

    public static String getTimeNotesLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, timeNotes).getLabel();
    }

    public static String getTimeNotesDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, timeNotes).getDescription();
    }

    public int getTimeNotesSize() {
        return org.jground.rx.def.apps.commons.TimeNote.wrap(rxObject.getComponents(AttName.timeNotes)).length;
    }

    public org.jground.rx.def.apps.commons.TimeNote[] getTimeNotes() {
        return org.jground.rx.def.apps.commons.TimeNote.wrap(rxObject.getComponents(AttName.timeNotes));
    }

    public org.jground.rx.def.apps.commons.TimeNote getTimeNotes(int index) {
        return org.jground.rx.def.apps.commons.TimeNote.wrap(rxObject.getComponents(AttName.timeNotes))[index];
    }

    public org.jground.rx.def.apps.commons.TimeNote createTimeNotes() {
        return org.jground.rx.def.apps.commons.TimeNote.wrap(rxObject.newComponent(timeNotes));
    }

    public void setTimeNotes(org.jground.rx.def.apps.commons.TimeNote[] values) {
        rxObject.set(timeNotes, _to_String(timeNotes));
    }

    public void addTimeNotes(org.jground.rx.def.apps.commons.TimeNote value) {
        rxObject.add(timeNotes, value.getOidString());
    }

    public static String getDocumentsLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, documents).getLabel();
    }

    public static String getDocumentsDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, documents).getDescription();
    }

    public int getDocumentsSize() {
        return org.jground.rx.def.apps.commons.Document.wrap(rxObject.getComponents(AttName.documents)).length;
    }

    public org.jground.rx.def.apps.commons.Document[] getDocuments() {
        return org.jground.rx.def.apps.commons.Document.wrap(rxObject.getComponents(AttName.documents));
    }

    public org.jground.rx.def.apps.commons.Document getDocuments(int index) {
        return org.jground.rx.def.apps.commons.Document.wrap(rxObject.getComponents(AttName.documents))[index];
    }

    public org.jground.rx.def.apps.commons.Document createDocuments() {
        return org.jground.rx.def.apps.commons.Document.wrap(rxObject.newComponent(documents));
    }

    public void setDocuments(org.jground.rx.def.apps.commons.Document[] values) {
        rxObject.set(documents, _to_String(documents));
    }

    public void addDocuments(org.jground.rx.def.apps.commons.Document value) {
        rxObject.add(documents, value.getOidString());
    }

    public static String getStatusLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, status).getLabel();
    }

    public static String getStatusDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, status).getDescription();
    }

    public void setStatus(String codeValue) {
        rxObject.set(status, _to_String(codeValue));
    }

    public String getStatus() {
        return _to_String(rxObject.getCurrentValue(status));
    }

    public static String get$CREATORLabel() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getLabel();
    }

    public static String get$CREATORDescription() {
        return RXSystem.getInstance().getRxService().getRXAttribute(moid, $CREATOR).getDescription();
    }

    public void set$CREATOR(String string) {
        rxObject.set($CREATOR, _to_String(string));
    }

    public String get$CREATOR() {
        return _to_String(rxObject.getCurrentValue($CREATOR));
    }

}
